Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set resolution factor to 1 when a mask is created #3102

Open
wants to merge 1 commit into
base: dev
Choose a base branch
from

Conversation

Marijn0
Copy link

@Marijn0 Marijn0 commented Jan 19, 2025

When the resolution dimmer slider was used (and not set to 100), and a motion or privacy mask was created/changed, the measurement of the width & height went wrong. Because the number of pixels in the image was less.
Example: When the resolution dimmer slider was set to 80 on a camera with a resolution of 1024x768, it measured 819x614.
The 819x614 was converted to the correct resolution when creating the mask file:
DEBUG: building editable motion mask for camera with id 1 (819x614)
DEBUG: editable mask needs resizing from 819x614 to 1024x768
But this caused the mask to change, probably due to the remainder that is or is not present and due to the resizing itself.

This PR makes sure that the resolutionfactor (controlled by the resolution dimmer slider) is always equal to 1 when creating a mask. I had to add a 1 second delay so that this could be processed before the resolution is measured with 'getCameraFrame'. I hope this approach is acceptable.

Issue: #2755

resolutionfactor=1 when a mask is made
@zagrim
Copy link
Collaborator

zagrim commented Jan 19, 2025

Do I get this right: With these changes the mask gets at least always edited with correct dimensions, since the user can't edit the mask with altered frame resolution? And due to that we only suffer from the possible small drift that is caused by mask being parsed and re-written every time any settings are saved?

The change looks really hackish with the timeout, though...

@Marijn0
Copy link
Author

Marijn0 commented Jan 19, 2025

Do I get this right: With these changes the mask gets at least always edited with correct dimensions, since the user can't edit the mask with altered frame resolution?

Yes

And due to that we only suffer from the possible small drift that is caused by mask being parsed and re-written every time any settings are saved?

Have not seen this happening without a resolution change.

The change looks really hackish with the timeout, though...

I agree, I'm open to better suggestions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants